<!doctype html>
<html lang="zh-CN">
<head>
  <title>清华大学学生教育互联网公益协会</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
  <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
  <script th:src = "@{/js/jquery.min.js}"></script>
  <script th:src = "@{/js/bootstrap.min.js}"></script>

  <style>
    .navbar-brand {
      padding: 0 15px;
    }
  </style>
</head>
<body>
  <div class="container">
    <header>
      <nav class="navbar navbar-default bg-faded">
        <div class="container-fluid">
          <!-- Brand and toggle get grouped for better mobile display -->
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" th:href="@{/{domain}(domain=${domain==null? '':domain}) }">
              <img th:src="@{/img/brand.jpg}" height="50"/>
            </a>
          </div>

          <!-- Collect the nav links, forms, and other content for toggling -->
          <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
              <li class="nav-item"><a th:href="@{/{domain}(domain=${domain==null? '':domain}) }">i玩问答</a></li>
              <li class="nav-item active"><a th:href="@{/profile}">个人信息</a></li>
              <li class="nav-item"><a th:if="${domain == null}" th:href="@{/volunteers}">哥哥姐姐</a></li>
              <li class="nav-item"><a th:if="${domain == null}" th:href="@{/look}">i玩课堂</a></li>
              <li class="nav-item"><a th:href="@{/logout}">退出登录</a></li>
            </ul>
          </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
      </nav>
    </header>
    <main>
      <form class="form-horizontal" method="post">
        <div class="form-group">
          <label for="username" class="col-sm-2 control-label">用户名</label>
          <div class="col-sm-10">
            <input name="username" type="text" class="form-control" id="username" th:value="${user.username}" readonly="true" />
          </div>
        </div>
        <div class="form-group">
          <label for="oldPassword" class="col-sm-2 control-label">原密码</label>
          <div class="col-sm-10">
            <input name="oldPassword" type="password" class="form-control" id="oldPassword" placeholder="如欲修改密码，请输入原始密码" />
          </div>
        </div>
        <div class="form-group">
          <label for="password" class="col-sm-2 control-label">新密码</label>
          <div class="col-sm-10">
            <input name="password" type="password" class="form-control" id="password" placeholder="如欲修改密码，请输入新密码" />
          </div>
        </div>
        <div class="form-group">
          <label for="nickname" class="col-sm-2 control-label">昵称</label>
          <div class="col-sm-10">
            <input name="nickname" type="text" class="form-control" id="nickname" th:value="${user.nickname}" />
          </div>
        </div>
        <div class="form-group">
          <label for="email" class="col-sm-2 control-label">邮箱</label>
          <div class="col-sm-10">
            <input name="email" type="email" class="form-control" id="email" th:value="${user.email}" readonly="true" />
          </div>
        </div>
        <div class="form-group">
          <label for="sex" class="col-sm-2 control-label">性别</label>
          <div class="col-sm-10">
          	<p class="form-control" th:if="${user.sex.toString() == 'MAIL'}">男</p>
          	<p class="form-control" th:if="${user.sex.toString() == 'FEMAIL'}">女</p>
          </div>
        </div>
        <div class="form-group">
          <label for="profile" class="col-sm-2 control-label">个人简介</label>
          <div class="col-sm-10">
            <textarea id="profile" name="profile" class="form-control" rows="3" th:inline="text">[[${user.profile}]]</textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary">保存</button>
            <p class="text-info" th:if="${success != null}" th:text="${success}"></p>
          	<p class="text-danger" th:if="${error != null}" th:text="${error}"></p>
          </div>
        </div>
      </form>
    </main>
  </div>
</body>
</html>
